package demo12;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public class test10 {
    public static void main(String[] args) {
        //读（硬盘向cpu输入数据）
        try(InputStream inputStream = new FileInputStream("d:/mma.txt")) {
            Scanner scanner = new Scanner(inputStream);
            byte[] arr = new byte[1024];
            int n = inputStream.read(arr);
            System.out.println("n = " + n);
            for(int i = 0 ; i <n ; i++) {
                System.out.printf("%x\n",arr[i]);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
